<template>
	<view>
		<view class="Tu" @longpress="ChangAn_BaoCun(imgURL)">
			<image :src="imgURL" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgURL:""
			}
		},
		onLoad(e) {
			this.imgURL = e.url;
		},
		methods: {
			ChangAn_BaoCun(e){
				uni.downloadFile({
					url: e,
					success: (res) => {
						if (res.statusCode === 200) {
							uni.saveImageToPhotosAlbum({
								filePath:res.tempFilePath,
								success: (res_) => {
									uni.showToast({
										title:"保存成功",
										icon:"none"
									})
								}
							})
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss">
page{
	background: #000;
}
.Tu{
	width: 100%;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}
</style>